{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Precision-Recall Curve"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from sklearn import datasets\n",
    "\n",
    "digits = datasets.load_digits()\n",
    "X = digits.data\n",
    "y = digits.target.copy()\n",
    "\n",
    "y[digits.target==9] = 1\n",
    "y[digits.target!=9] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train,X_test, y_train,y_test = train_test_split(X,y, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "log_reg = LogisticRegression()\n",
    "log_reg.fit(X_train, y_train)\n",
    "decision_scores = log_reg.decision_function(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import precision_score,recall_score\n",
    "\n",
    "precisions = []\n",
    "recalls = []\n",
    "thresholds = np.arange(decision_scores.min(), decision_scores.max(), 0.1)\n",
    "for threshold in thresholds:\n",
    "    y_predict = np.array(decision_scores>=threshold, dtype='int')\n",
    "    precisions.append(precision_score(y_test, y_predict))\n",
    "    recalls.append(recall_score(y_test, y_predict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDI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L6Pv8Db0TME6nfUJY752503poKBfNdugHWjfC5rEy5ELgWeNXMXk7t+wfga3hdptcD28nwtOm6Q1VEpAAVW7eMiEhRULiLiBQghbuISAFSuIuIFCCFu4hIAVK4i4gUIIW7iEgBUriLiBSg/w/i4Kb11ZnZbQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x29598a5b8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(thresholds, precisions)\n",
    "plt.plot(thresholds, recalls)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Precision-Recall 曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAFGNJREFUeJzt3X9wndWd3/H3V/IvDMY2tgFjW4gEk8F4d2OiUghtIBs2MXRqZzvJDt6ku0mZeGcb0swmkymd7LApm51pw2R2kh3oxm3ThEwTYNNu1s2acRsKTZpgapMQAmbZFV4by3KwsSz/kCzJsr7944pEliXdK+lK9+rR+zWjmfvc5+h5vnOwPz6ce+55IjORJBVLQ60LkCRVn+EuSQVkuEtSARnuklRAhrskFZDhLkkFZLhLUgEZ7pJUQIa7JBXQnFrdePny5dnc3Fyr20vSjPTcc8+9kZkryrWrWbg3NzezZ8+eWt1ekmakiDhQSTunZSSpgAx3SSogw12SCshwl6QCMtwlqYDKhntEfDUijkTEi6Ocj4j4ckS0RsQLEXFj9cuUJI1HJSP3rwEbxzh/J7B28Gcr8B8mX5YkaTLKrnPPzO9HRPMYTTYDj2TpeX27ImJJRKz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6SVED/HxP0lHFxDYe8AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x29598a722b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(precisions, recalls)\n",
    "plt.show()\n",
    "# 急剧下降的点, 便是精准率和召回率最佳点"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Scikit-learn中的Precision-Recall曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import precision_recall_curve"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# decision_scores = log_reg.decision_function(X_test)\n",
    "precisions, recalls, thresholds = precision_recall_curve(y_test, decision_scores)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145,)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# decision_score的步长是sklearn自动确定最佳的\n",
    "precisions.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145,)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recalls.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(144,)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# the last precision and recall values are 1 and 0 respectively\n",
    "# don't have a corresponding threshold\n",
    "thresholds.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRA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YuIRCGVu4hIFFK5i4hEof8PkSIZvyU+Mx0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x29598c56518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(thresholds, precisions[:-1])\n",
    "plt.plot(thresholds, recalls[:-1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAFg1JREFUeJzt3X2QXfV93/H3V6tnoQeQFiH0gASWCDJYNd6CH1qbxriRSS2SmFAY54EWm9g1jhs7bWjxuB6SNI49NhOnilsVM8ZMbULItMiMMIkNFGMjGzHmSagCIWG0CEm7kpC0Enrcb//Yi2e97OqeK9279+7Z92tGM+fc+9tzPnvmzkdnzzn3nMhMJEnlMqbZASRJ9We5S1IJWe6SVEKWuySVkOUuSSVkuUtSCVnuklRClrsklZDlLkklNLZZK541a1YuXLiwWauXpBHpiSee6M7M9mrjmlbuCxcuZN26dc1avSSNSBHx8yLjPCwjSSVkuUtSCVnuklRClrsklZDlLkklVLXcI+L2iNgZEc8O8X5ExNciYlNEPB0RF9c/piSpFkX23L8JLD/B+x8EFlf+3QB8/dRjSZJORdVyz8xHgN0nGHIl8K3ssxaYERFz6hVwKDv2HeK/rtnArp7DjV6VJI049TjmPhfY2m++s/Lam0TEDRGxLiLWdXV1ndJKVz2ymW88uoUDh4+f0nIkqYzqUe4xyGuDPnU7M1dlZkdmdrS3V/327JB2HzjCt3/yMiuWnc2CmZNPejmSVFb1KPdOYH6/+XnAtjosd0i3P7qF148e599ddl4jVyNJI1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Kf3W2Z+VuZ+Xbg5spre4cvYs1q7bvaNPOEwyAnGMYCm+n7k/WNkyZvHTBmcb/pD9H3HNeWzTtg/MM094Rqke07p9/0bwJrWzjrcuCOyvQs+v7EndmqeSvjzgdeovIdkxb/LNwPXFeZvoC+4mlK7oJ5ZwFjKtN/DtzSzG1cybGQoU+o/jq/fEL1p3Vdd7N/+UF+4SuA5+k7M35z5bVbgBWV6b8C1gNP0nfSZMgybYW8A8Y2tdwLbt+/qGzfpyrb91daOGsAXwWeA54BrmnlbVuZ/wLwxWbmrGH7LgV+VPksPAn8yxbPexXwQmXMbcCEJuf9DvAqcJS+vfTrgY8DH6+8H8DKyu/zTL27wW+oSlIJtdoxd0lSHVjuklRClrsklZDlLkklZLlLUglZ7pJUQpa7JJWQ5S5JJfT/AXykqqlyziJkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x29598c50160>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(precisions, recalls)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
